/*begin
2015-04-23 10:35:22 By wd@5173.com*/
(function(a) {
    a.extend({
        LAYER: {
            openID: "",
            position: "",
            mt: "",
            parentIsLoad: true,
            init: function(b) {
                if (b == undefined) b = "UED_box";
                if (this.parentIsLoad) {
                    a('<div id="' + b + '"></div>').appendTo("body");
                    a('<div class="UED_SHUCOVER_V1 UED_hide" id="UED_SHUCOVER_V1"><iframe class="UED_SHUCOVER_IFRAME_V1" id="UED_SHUCOVER_IFRAME_V1" src="https://images002.5173cdn.com/html/blank.html"></iframe></div>').appendTo("body");
                    this.parentIsLoad = false
                }
            },
            show: function(b) {
                var c = {
                    overlay: {
                        color: "#000",
                        opacity: 0.5
                    },
                    position: "fixed",
                    mt: "200px",
                    layerContainer: "UED_LAYER_PARENT_FRAME_V1"
                };
                c = a.extend(c, b);
                if (!document.getElementById(c.id)) {
                    alert("\u5f39\u51fa\u5c42\u51fa\u9519: \u9875\u9762\u4e0a\u6ca1\u6709\u53d1\u73b0id=" + c.id);
                    return false
                }
                this.init(c.layerContainer);
                this.position = c.position;
                this.mt = c.mt;
                this.openID = b.id;
                this.setpos(a("#" + this.openID));
                this.is6FIX("100%");
                a("#" + this.openID).prependTo(a("#" + c.layerContainer)).show();
                a("#UED_SHUCOVER_V1").css({
                    "background-color": c.overlay.color,
                    opacity: c.overlay.opacity
                }).show()
            },
            setpos: function(b) {
                b.addClass("UED_LAYER_PARENT_V1");
                var c = b.height(),
                d = b.width();
                b.css({
                    "margin-left": d / 2 * -1 + "px",
                    "margin-top": c / 2 * -1 + "px"
                });
                if (c > (document.body.clientHeight == 0 ? document.body.clientHeight: document.documentElement.clientHeight) || this.position === "absolute") b.css({
                    top: this.mt,
                    position: "absolute",
                    marginTop: "0"
                })
            },
            close: function() {
                a("#" + this.openID).hide();
                a("#" + this.openID).removeClass("UED_LAYER_PARENT_V1");
                a("#UED_SHUCOVER_V1").hide();
                this.is6FIX("auto")
            },
            is6FIX: function(b) {
                if (a.browser.msie && a.browser.version == "6.0") {
                    a("html").css({
                        height: b
                    });
                    a("body").css({
                        height: b
                    })
                }
            }
        }
    })
})(jQuery);